<?php

chdir(dirname(__FILE__)."/../..");
$path = getcwd();
chdir("../");
$path3 = getcwd();
chdir(dirname(__FILE__));
#debug($path3 , $path2);
include_once $path3."/lib/core.class.php";


class CustomerEdit extends IPlugin 
{
    function CustomerEdit($parent = null)
    {
        IPlugin::IPlugin($parent);
        $this->tplfolder = dirname(__FILE__)."/tpl";
    }

    function getPluginTag() { return "customeredit"; }
    function getPluginName() { return "Customer Edit Plugin"; }
    function getPluginVersion() { return "1.0.0"; }


    function getProperty($p = null)
    {
        if(null == $p)
        {
            return array("MenuTitle");
        }
        $result = "";
        switch ($p)
        {
            case "MenuTitle" : { return "Edit Customer"; } break;
        };
        return $result;
    }

    function doAction($params = null)
    {
        if(null != ($result = IPlugin::doAction($params)))
        {
            return $result;
        }

        $arg = getCoreInstance();
        $arg = $arg->getGET();
        
        if("echo" == $arg["action"])
        {
            echo "CustomerEdit: echo: ".$arg["string"];
        }
        return true;
    }
    
    function Render($params)
    {
        if(null != ($result = IPlugin::Render($params)))
        {
            return $result;
        }
        
        // history
        $ret = array();
        $obj = $this;
        while(null != $obj)
        {
            $z = array_flip($obj->getProperty());
            if(isset($z["MenuTitle"]))
            {
                $ret[$obj->getProperty("MenuTitle")] = "http://";
            }
            $obj = $obj->parent;
        }
        return "CustomerEdit: Render: Yo-ho-ho";
    }
};


?>